package system.student.mapper;

import system.student.annotate.LogRecord;
import system.student.entity.Course;
import system.student.entity.Score;
import system.student.entity.StudentDetail;
import system.student.entity.user.Student;

import java.util.List;

public interface CourseMapper {

    /**
     * 查询所有课程
     * @param teacherId
     * @return
     */
    List<Course> findAllCourse(Long teacherId);

    /**
     * 根据课程id查询所有学生
     * @param courseId
     * @return
     */
    List<Student> findAllStudent(Long courseId);

    /**
     * 添加课程
     * @param course
     */
    @LogRecord(module = "课程", operation = "添加课程", operatorType = "添加课程")
    void addCourse(Course course);

    /**
     * 添加成绩
     * @param studentScore
     */
    void updateScore(Score studentScore);

    /**
     * 根据课程id和学生id查询学生
     * @param studentScore
     * @return
     */
    List<StudentDetail> findStudentById(Score studentScore);

    /**
     * 根据课程id查询所有学生id和姓名
     * @param courseId
     */

    List<Student> findAllStudentIDAndNameByCourseId(Long courseId);
}
